import React, { useState} from 'react';
import {createEditor, Editor, Transforms} from 'slate';
import { Slate, Editable, withReact } from 'slate-react';
//TODO 啥也不是，整个框架占位置，现在白板的跟text没区别

const RichTextEditor = ({value, onChange}) => {
    // 创建一个 Slate 编辑器实例
    const [editor] = useState(() => withReact(createEditor()))

    return (
        <Slate
            editor={editor}
            value={value}
            onChange={(newValue) => onChange(newValue)}
            initialValue={value}>
            <Editable
                placeholder="请输入内容..."
                style={{ border: '1px solid #ccc', padding: '10px' }}
            />
        </Slate>
    );
};



export default RichTextEditor;